<template>
    <div>
       <el-dropdown @command="handleCommand">
    <span class="el-dropdown-link">
      <img class="el-dropdown-img" src="" alt="">
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item :icon="userFilled" :command={a:1}>个人信息</el-dropdown-item>
        <el-dropdown-item :icon="lock" :command={a:2}>修改密码</el-dropdown-item>
        <el-dropdown-item :icon="right" :command={a:3}>退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
    </div>
</template>
<script>
import http from "../util/http";
import { mapActions } from 'vuex';
import { userFilled,lock,right } from '@element-plus/icons-vue'

export default {

    data(){
        return{
            token:"",
            userFilled,
            lock,
            right,
        }
    },
    created(){
        this.myinfo()
    },
     methods:{
        ...mapActions(["myinfodata"]),
        myinfo(){
            let infodata = {
                _gp:'admin',
                _mt:'info',
            }
            http.post(infodata).then((res)=>{
                    this.myinfodata(res.data.data)
                console.log(res,"请求成功1212");
            }).catch((err)=>{
                console.log(err,"请求失败");
            })
        },
        handleCommand(e){
            switch (e.a) {
                case 1:
                    this.$router.push("/index/myselfinfo")
                    break;
                case 2:
                     this.$router.push("/index/mypassword")
                    break;
                case 3:
                    
                    break;
            
                default:
                    break;
            }
        },
     }
}
</script>
<style lang="less" scoped>
.el-dropdown-link{
    width: 30px;
    height: 30px;
    border: antiquewhite 1px solid;
    border-radius: 50%;
    background-color: rgb(241, 247, 247);
    overflow: hidden;
    .el-dropdown-img{
          width: 100%;
    }
}
</style>